<?php

namespace App\Api\Controllers;

class UserController extends BaseController
{

    /**
     * @apiDefine login 登入类
     */
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $result = $this->user_id;
        if ($result) {
            return $this->success("uid");
        }
        return $this->success('user');
    }

    /**
     * 处理用户登出
     * @return \Illuminate\Http\JsonResponse
     */
    public function logout()
    {
        auth('api')->logout();

        return $this->success('退出成功');
    }
}
